<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta charset="utf-8" />
<title>Tables - Ace Admin</title>

<meta name="description" content="Static &amp; Dynamic Tables" />
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

<!-- bootstrap & fontawesome -->
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/bootstrap.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/font-awesome.min.css" />
<!-- page specific plugin styles -->
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/jquery-ui.custom.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/chosen.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/bootstrap-datepicker3.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/bootstrap-timepicker.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/daterangepicker.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/bootstrap-datetimepicker.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/bootstrap-colorpicker.min.css" />

<!-- ace styles -->
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/ace.min.css"
	id="main-ace-style" />

<!--[if lte IE 9]>
			<link rel="stylesheet" href="<%=request.getContextPath()%>/ace/assets/css/ace-part2.min.css" />
		<![endif]-->
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/ace-skins.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/ace-rtl.min.css" />

<!--[if lte IE 9]>
		  <link rel="stylesheet" href="<%=request.getContextPath()%>/ace/assets/css/ace-ie.min.css" />
		<![endif]-->

<!-- inline styles related to this page -->

<!-- ace settings handler -->
<script
	src="<%=request.getContextPath()%>/ace/assets/js/ace-extra.min.js"></script>

<!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

<!--[if lte IE 8]>
		<script src="<%=request.getContextPath()%>/ace/assets/js/html5shiv.min.js"></script>
		<script src="<%=request.getContextPath()%>/ace/assets/js/respond.min.js"></script>
		<![endif]-->
</head>

<body class="no-skin">

	<c:if test="${not empty msg}">
    	<div id="myAlert" class="alert alert-warning">
			<a href="#" class="close" data-dismiss="alert">&times;</a>
			<strong>警告！</strong>${msg }。
		</div>
	</c:if>
	<div class="page-content">
		<!-- /section:settings.box -->
		<div class="page-content-area">
			<div class="row">
				<div class="col-xs-12">
					<!-- PAGE CONTENT BEGINS -->
					<div class="row">
						<div class="col-xs-12">
							<div class="table-header">提现列表</div>

							<!-- <div class="dataTables_borderWrap"> -->
							<div>
								<div id="sample-table-2_wrapper"
									class="dataTables_wrapper form-inline no-footer">
									<form action="<%=request.getContextPath()%>/bsbWithdraw/list.do"
										method="get" id="drizzt-table">
										<div class="row">
											<div class="col-xs-6">
												<table cellspacing="0" cellpadding="0" border="0"
													style="float: left; table-layout: auto;"
													class="ui-pg-table navtable">
													<tbody>
														
													</tbody>
												</table>
											</div>
											<div class="col-xs-6">
													<div class="input-group input-group-sm">
														<select name="status">
															<option value="">--请选择状态--</option>
															<c:forEach items="${selects }" var="sel">
																<option value="${sel.index }" <c:if test="${status==sel.index }">selected</c:if>>${sel.name }</option>
															</c:forEach>
														</select>
													</div>
													<div class="input-group input-group-sm">
														<input type="text" placeholder="手机号" name="phone" value="${phone }" id="phone"  class="form-control" />
														<span class="input-group-addon">
															<i class="ace-icon fa fa-phone"></i>
														</span>
														
													</div>
													<button type="button" onclick="search()" class="btn btn-purple btn-sm" style="vertical-align:top;">
														<span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
														搜索
													</button>
											</div>
										</div>
										<table
											class="table table-striped table-bordered table-hover dataTable no-footer"
											id="sample-table-2" role="grid"
											aria-describedby="sample-table-2_info">
											<thead>
												<tr role="row">
														<th class="sorting_disabled">昵称</th>
														<th class="sorting_disabled">手机号</th>
														<th class="sorting_disabled">提现金额</th>
														<th class="sorting_disabled">申请时间</th>
														<th class="sorting_disabled">用户身份</th>
														<th class="sorting_disabled">提现状态</th>
														<th class="sorting_disabled">到账时间</th>
													<th class="sorting_disabled">操作</th>
												</tr>
											</thead>

											<tbody>
												<c:forEach items="${bsbWithdraws}" var="bsbWithdraw">
													<tr role="row" class="odd">
															<td>${bsbWithdraw.nickname}</td>
															<td>${bsbWithdraw.phone}</td>
															<td>${bsbWithdraw.money}</td>
															<td><fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss" value="${bsbWithdraw.createDate}" /></td>
															<!-- 角色: 0 普通用户 1解税宝用户 2 事务所管理员 3 咨询师 4 专家 -->
															<td>${bsbWithdraw.role=='0'?"普通用户":bsbWithdraw.role=='1'?"解税宝用户":bsbWithdraw.role=='2'?"事务所管理员":bsbWithdraw.role=='3'?"咨询师":bsbWithdraw.role=='4'?"专家":"未知"}</td>
															<!--提现状态：0到账;1待审核;2审核通过;3审核不通过;4异常;5异常已处理并返还余额  -->
															<td>${bsbWithdraw.status=='0'?"已到账":bsbWithdraw.status=='1'?"待审核":bsbWithdraw.status=='2'?"审核通过":bsbWithdraw.status=='3'?"审核不通过":bsbWithdraw.status=='4'?"异常":bsbWithdraw.status=='5'?"异常已处理":"未知"}</td>
															<td><fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss" value="${bsbWithdraw.sucDate}" /></td>
														<td>
										                    <shiro:hasPermission name="bsbWithdraw:view">
										                        <a class="blue"  href="<%=request.getContextPath()%>/bsbWithdraw/${bsbWithdraw.uuid}/view">
																	<i class="ace-icon fa fa-search-plus bigger-130"></i>查看
																</a>
										                    </shiro:hasPermission>
										                    <c:if test="${status==1 && bsbWithdraw.status==1 }">
											                    <shiro:hasPermission name="bsbWithdraw:check">
											                        <a class="green" onclick="javascript:goOperate('check','${bsbWithdraw.uuid}')">
																		<i class="ace-icon fa fa-pencil bigger-130"></i>审核
																	</a>
											                    </shiro:hasPermission>
										                    </c:if>
										
										                </td>
													</tr>
												</c:forEach>
											</tbody>
										</table>
										<div class="row">
											<div class="col-xs-6">
												<div class="dataTables_info" id="sample-table-2_info"
													role="status" aria-live="polite">
													共 ${totalCount} 条数据，当前第<input type="text" id="pageNum"
														name="pageNum" style="width: 40px;" value="${pageNum}" />页&nbsp;&nbsp;
													<input type="button" class="btn btn-sm btn-primary" onclick="goPage(0)" value="跳转"></input>
												</div>
											</div>
											<div class="col-xs-6">
												<div class="dataTables_paginate paging_simple_numbers"
													id="sample-table-2_paginate">
													<ul class="pagination">
														<li class="paginate_button <c:if test="${pageNum==1}">disabled</c:if>"
															aria-controls="sample-table-2" tabindex="0"
															id="sample-table-2_previous"><a href="#"
															onclick="goPage(1)">首页</a></li>
														<li class="paginate_button <c:if test="${pageNum==1}">disabled</c:if>"
															aria-controls="sample-table-2" tabindex="0"
															id="sample-table-2_previous"><a href="#"
															onclick="goPage(${pageNum}-1)">上一页</a></li>
														<li class="paginate_button <c:if test="${pageNum==maxPageNum}">disabled</c:if>" aria-controls="sample-table-2"
															tabindex="0" id="sample-table-2_previous"><a
															href="#" onclick="goPage(${pageNum}+1)">下一页</a></li>
														<li class="paginate_button <c:if test="${pageNum==maxPageNum}">disabled</c:if>" aria-controls="sample-table-2"
															tabindex="0" id="sample-table-2_previous"><a
															href="#" onclick="goPage(${maxPageNum})">尾页</a></li>
													</ul>
												</div>
											</div>
										</div>
									</form>
								</div>
							</div>
						</div>
					</div>
					<!-- PAGE CONTENT ENDS -->
				</div>
				<!-- /.col -->
			</div>
			<!-- /.row -->
		</div>
		<!-- /.page-content-area -->
	</div>

</body>

<!-- basic scripts -->

<!--[if !IE]> -->
<script type="text/javascript">
	window.jQuery
			|| document
					.write("<script src='<%=request.getContextPath()%>/ace/assets/js/jquery.min.js'>"
							+ "<"+"/script>");
</script>

<!-- <![endif]-->

<!--[if IE]>
<script type="text/javascript">
 window.jQuery || document.write("<script src='<%=request.getContextPath()%>/ace/assets/js/jquery1x.min.js'>"+"<"+"/script>");
</script>
<![endif]-->
<script type="text/javascript">
	if ('ontouchstart' in document.documentElement)
		document.write("<script src='<%=request.getContextPath()%>/ace/assets/js/jquery.mobile.custom.min.js'>"+ "<"+"/script>");
</script>

<script type="text/javascript">
	function goPage(pageNum){
		if(pageNum!=0){
			$("#pageNum").val(pageNum);
		}
		var myreg=/^[0-9]*$/;
		if(!myreg.test($("#pageNum").val())){
			alert("请输入有效数字！");
			$("#pageNum").val(1);
			return false;
		}
		$("#drizzt-table").submit();
	}
	
	function goOperate(operate,uuid){
		if(operate=="add"){
			$("#drizzt-table").attr("action", "<%=request.getContextPath()%>/bsbWithdraw/toAdd.do");
			$("#drizzt-table").submit();
		}
		if(operate=="edit"){
			var val=$("#uuid:checked").val();
			if(val==null){
                alert("请选择一条数据");
                return false;
            }else{
				$("#drizzt-table").attr("action", "<%=request.getContextPath()%>/bsbWithdraw/toEdit.do");
				$("#drizzt-table").submit();
            }
		}
		if(operate=="check"){
			$("#drizzt-table").attr("action", "<%=request.getContextPath()%>/bsbWithdraw/"+uuid+"/check");
			$("#drizzt-table").submit();
		}
		
		if(operate=="view"){
			var val=$("#uuid:checked").val();
			if(val==null){
                alert("请选择一条数据");
                return false;
            }else{
				$("#drizzt-table").attr("action", "<%=request.getContextPath()%>/bsbWithdraw/view.do");
				$("#drizzt-table").submit();
            }
		}
	}
</script>
<script
	src="<%=request.getContextPath()%>/ace/assets/js/bootstrap.min.js"></script>
<script src="<%=request.getContextPath()%>/ace/assets/js/bootbox.js"></script>
<script type="text/javascript">
function search(){
	$("#drizzt-table").submit();
}
</script>
</html>
